<template>
  <div>
    <my-header></my-header>
    <!-- 轮播图 carousel-->
    <carousel></carousel>
    <!-- 内容部分 content -->
    <div class="content" id="content">
      <div class="container">
        <!-- 出版图书 -->
        <div class="pubbook">
          <div class="pubtitle">
            <h2>出版图书</h2>
            <p>
              <a href="#">小说</a>| <a href="#">励志成功</a>|
              <a href="#">文学</a>| <a href="#">经济管理</a>|
              <a href="#">更多</a>
            </p>
          </div>
          <div class="show">
            <s class="sign"></s>
            <div class="showL">
              <h3>
                <router-link :to="`details/${arr.bid}`">{{ arr.title }}</router-link>
              </h3>
              <p class="author">{{ arr.author }}</p>
              <p class="introduce">
                {{ arr.brief }}
              </p>
              <span>
                <router-link :to="`details/${arr.bid}`">
                  <img :src="arr.lg_img" class="bookCover" />
                </router-link>
                <img
                  src="https://pweb.d.zhangyue01.com/static/images/index/shadow.gif"
                  class="shadow"
                />
              </span>
            </div>
            <ul class="showM">
              <li v-for="(m, i) of arr2" :key="i">
                <router-link :to="`details/${m.bid}`">
                  <img :src="m.lg_img" />
                </router-link>
                <p class="bookName">
                  <router-link :to="`details/${m.bid}`">{{ m.title }}</router-link>
                </p>
                <p>{{ m.author }}</p>
              </li>
            </ul>
            <div class="showR">
              <h3>
                <s class="crown"></s>
                <a href="#">畅销榜</a>
              </h3>
              <collapse></collapse>
            </div>
          </div>
        </div>
        <!-- 精选图书 -->
        <div class="jxbook">
          <div class="jxtitle">
            <h2>精选圈子</h2>
          </div>
          <div class="jxshow">
            <ul class="cirbig">
              <li>
                <span class="cirHead">
                  <a href="#">
                    <img
                      src="https://bookbk.img.zhangyue01.com/idc_1/m_1,w_300,h_400/ce16384b/group6/M00/EF/08/CmQUNlswWuGEI-P_AAAAAGcokYo470353353.jpg?v=zCb05qFg&t=CmQUNlswWuE."
                      title="古代言情"
                    />
                  </a>
                  <s class="fire"></s>
                </span>
                <h3><a href="#" title="古代言情">古代言情</a></h3>
                <p class="little">相望古言，相聚古言，古言–我们的家园</p>
                <span class="attent">
                  <s class="fans"></s>
                  <i>34w+</i>
                  <s class="cards"></s>
                  <i>36568</i>
                </span>
              </li>
              <li class="middle">
                <span class="cirHead">
                  <a href="#">
                    <img
                      src="https://bookbk.img.zhangyue01.com/idc_1/m_1,w_300,h_400/b1fb4c32/group6/M00/EF/08/CmQUNlswW06Ec5WmAAAAACImj3c976890971.jpg?v=pEoO4QEx&t=CmQUNlswW04."
                      title="古代言情"
                    />
                  </a>
                  <s class="fire"></s>
                </span>
                <h3><a href="#" title="现代言情">现代言情</a></h3>
                <p class="little">Hey, 你的少女心♥掉在这里了...</p>
                <span class="attent">
                  <s class="fans"></s>
                  <i>34w+</i>
                  <s class="cards"></s>
                  <i>36568</i>
                </span>
              </li>
              <li>
                <span class="cirHead">
                  <a href="#">
                    <img
                      src="https://bookbk.img.zhangyue01.com/idc_1/m_1,w_300,h_400/bfadaf77/group6/M00/EF/11/CmQUN1swh_mEfkV0AAAAANKnaaU020118518.jpg?v=Q1NQqWqL&t=CmQUN1swh_k."
                      title="古代言情"
                    />
                  </a>
                  <s class="fire"></s>
                </span>
                <h3><a href="#" title="青春校园">青春校园</a></h3>
                <p class="little">
                  青嶂青溪直复斜，春雪空濛帘外寒；校量功力相千万，园林月白秋霖散。
                </p>
                <span class="attent">
                  <s class="fans"></s>
                  <i>34w+</i>
                  <s class="cards"></s>
                  <i>36568</i>
                </span>
              </li>
            </ul>

            <!-- 第二排 文字-->
            <div class="zwtit">
              <img
                src="https://pweb.d.zhangyue01.com/static/images/common/zwtit.png"
              />
            </div>
            <ul class="cirLittle zwqz">
              <li>
                <span class="litHead">
                  <a href="#">
                    <img
                      src="https://bookbk.img.zhangyue01.com/idc_1/m_1,w_300,h_400/71fee514/group6/M00/1C/74/CmRablswwt2EKu2UAAAAAOQZ58o026610528.jpg?v=w64zJDdg&t=CmRablswwt0."
                    />
                  </a>
                </span>
                <div class="bookCon">
                  <h3><a href="#">情感</a></h3>
                  <p>0部作品</p>
                </div>
              </li>
              <li>
                <span class="litHead">
                  <a href="#">
                    <img
                      src="https://bookbk.img.zhangyue01.com/idc_1/m_1,w_300,h_400/2ab99546/group6/M00/EF/16/CmQUNlswbOaEQwe_AAAAAIWAkFQ186283339.jpg?v=8N8Z8LMS&t=CmQUNlswbOY."
                    />
                  </a>
                </span>
                <div class="bookCon">
                  <h3><a href="#">科幻</a></h3>
                  <p>0部作品</p>
                </div>
              </li>
              <li>
                <span class="litHead">
                  <a href="#">
                    <img
                      src="https://bookbk.img.zhangyue01.com/idc_1/m_1,w_300,h_400/467cba7c/group6/M00/1C/2F/CmRae1swXU6EKGW2AAAAAJBPyUs060526757.jpg?v=j5BKgYCC&t=CmRae1swXU4."
                    />
                  </a>
                </span>
                <div class="bookCon">
                  <h3><a href="#">情感</a></h3>
                  <p>0部作品</p>
                </div>
              </li>
              <li>
                <span class="litHead">
                  <a href="#">
                    <img
                      src="https://bookbk.img.zhangyue01.com/idc_1/m_1,w_300,h_400/8c743f75/group6/M00/1D/00/CmRaelszMT-EDFwHAAAAAKqS8cs181978067.jpg?v=48satnrL&t=CmRaelszMT4."
                    />
                  </a>
                </span>
                <div class="bookCon">
                  <h3><a href="#">情感</a></h3>
                  <p>0部作品</p>
                </div>
              </li>
              <li>
                <span class="litHead">
                  <a href="#">
                    <img
                      src="https://bookbk.img.zhangyue01.com/idc_1/m_1,w_300,h_400/4c61e2a0/group6/M00/EF/09/CmQUNlswW6iEAzRwAAAAANMnZTE319229773.jpg?v=ewnsQJEf&t=CmQUNlswW6g."
                    />
                  </a>
                </span>
                <div class="bookCon">
                  <h3><a href="#">情感</a></h3>
                  <p>0部作品</p>
                </div>
              </li>
            </ul>
          </div>
        </div>
        <!-- 男生频道 -->
        <div class="nsbook">
          <div class="pubtitle">
            <h2>男生频道</h2>
            <p>
              <a href="#">玄幻</a>| <a href="#">奇幻</a>| <a href="#">武侠</a>|
              <a href="#">仙侠</a>|
              <a href="#">更多</a>
            </p>
          </div>
          <div class="show">
            <s class="sign"></s>
            <div class="showL">
              <h3>
                <router-link :to="`details/${arr3.bid}`">{{ arr3.title }}</router-link>
              </h3>
              <p class="author">{{ arr3.author }}</p>
              <p class="introduce">
                {{ arr.brief }}
              </p>
              <span>
                <router-link :to="`details/${arr3.bid}`">
                  <img :src="arr3.lg_img" class="bookCover" />
                </router-link>
                <img
                  src="https://pweb.d.zhangyue01.com/static/images/index/shadow.gif"
                  class="shadow"
                />
              </span>
            </div>
            <ul class="showM">
              <li v-for="(p, i) of arr5" :key="i">
                <h3>
                  <router-link :to="`details/${p.bid}`" :title="p.title">{{ p.title }}</router-link>
                </h3>
                <p class="name">{{ p.author }}</p>
                <p class="introduce">
                  {{ p.brief }}
                </p>
              </li>
            </ul>
            <div class="showR">
              <h3>
                <s class="crown"></s>
                <a href="#">畅销榜</a>
              </h3>
              <collapse></collapse>
            </div>
          </div>
        </div>
        <!-- 女生频道 -->
        <div class="nsbook">
          <div class="pubtitle">
            <h2>女生频道</h2>
            <p>
              <a href="#">现代言情</a>| <a href="#">古代言情</a>| <a href="#">幻想言情</a>|
              <a href="#">青春校园</a>|
              <a href="#">更多</a>
            </p>
          </div>
          <div class="show">
            <s class="sign"></s>
            <div class="showL">
              <h3>
                <router-link :to="`details/${arr4.bid}`">{{ arr4.title }}</router-link>
              </h3>
              <p class="author">{{ arr4.author }}</p>
              <p class="introduce">
                {{ arr4.brief }}
              </p>
              <span>
                <router-link :to="`details/${arr4.bid}`">
                  <img :src="arr4.lg_img" class="bookCover" />
                </router-link>
                <img
                  src="https://pweb.d.zhangyue01.com/static/images/index/shadow.gif"
                  class="shadow"
                />
              </span>
            </div>
            <ul class="showM">
              <li v-for="(p, i) of arr6" :key="i">
                <h3>
                  <router-link :to="`details/${p.bid}`" :title="p.title">{{ p.title }}</router-link>
                </h3>
                <p class="name">{{ p.author }}</p>
                <p class="introduce">
                  {{ p.brief }}
                </p>
              </li>
            </ul>
            <div class="showR">
              <h3>
                <s class="crown"></s>
                <a href="#">畅销榜</a>
              </h3>
              <collapse></collapse>
            </div>
          </div>
        </div>
      </div>
    </div>
    <my-footer></my-footer>
    <my-top></my-top>
  </div>
</template>
<script>
import MyHeader from "../components/MyHeader";
import MyFooter from "../components/MyFooter";
import MyTop from "../components/MyTop";
import Carousel from "../components/Carousel";
import Collapse from "../components/Collapse";

export default {
  components: {
    MyHeader,
    MyFooter,
    MyTop,
    Carousel,
    Collapse,
  },
  data() {
    return {
      arr: {},
      arr2: [],
      arr3: {},
      arr4: {},
      arr5: [],
      arr6: [],
    };
  },
  mounted() {
    var bid = parseInt(Math.random() * 30);
    this.axios.get("/indexread/indexread/" + bid).then((res) => {
      // console.log(res.data);
      this.arr = res.data[0];
      // console.log(this.arr.lg_img)
    });
    var bid2 = parseInt(Math.random() * 30);
    this.axios.get("/indexread/indexread/" + bid2).then((res) => {
      // console.log(res.data);
      this.arr3 = res.data[0];
      // console.log(this.arr3.lg_img)
    });
    var bid3 = parseInt(Math.random() * 30);
    this.axios.get("/indexread/indexread/" + bid3).then((res) => {
      this.arr4 = res.data[0];
    });
    var pno = parseInt(Math.random() * 15);
    this.axios.get("/indexread/mlist/" + pno).then((res) => {
      // console.log(res.data);
      this.arr2 = res.data.data;
    });
    var pno2 = parseInt(Math.random() * 10);
    this.axios.get("/indexread/plist/" + pno2).then((res) => {
      console.log(res.data);
      this.arr5 = res.data.data;
    });
    var pno3 = parseInt(Math.random() * 10);
    this.axios.get("/indexread/plist/" + pno3).then((res) => {
      console.log(res.data);
      this.arr6 = res.data.data;
    });
  },
};
</script>
<style scoped>
*{
  box-sizing: content-box;
}
#content {
  list-style: none;
  color: #9e9e9e;
  font: 12px/20px "Microsoft Yahei", arial, sans-serif;
  font-weight: normal;
}
.container {
  margin-left: auto;
  margin-right: auto;
  width: 1000px;
}
a {
  text-decoration: none;
  outline: none;
  font-family: "Microsoft Yahei", arial, sans-serif;
  color: #9e9e9e;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
img {
  /* 让图片(行内块元素)与同一行中的内容竖直居中对齐 */
  vertical-align: middle;
}
input {
  outline: none;
}
h2,
h3 {
  font-style: normal;
  font-weight: normal;
}
s {
  background: url(https://pweb.d.zhangyue01.com/static/images/common/icon.png)
    no-repeat;
}
.carousel {
  width: 1000px;
  height: 302px;
  margin: 0 auto;
  padding-top: 30px;
  text-align: center;
  background-color: #d2c5b2;
}
.content {
  margin: 0 auto;
}

/* 内容 出版图书 */
.pubtitle {
  text-align: center;
  padding: 44px 0 30px 0;
}
.pubtitle h2 {
  font-size: 26px;
  color: #212121;
  height: 36px;
  margin: 0;
}
.pubtitle p {
  color: #9e9e9e;
  margin: 0;
}
.pubtitle p a {
  margin: 0 4px;
}

.content .show {
  height: 526px;
  background: #fff;
  position: relative;
}
.content .show .sign {
  width: 63px;
  height: 63px;
  background-position: -26px 0;
  position: absolute;
  left: 0;
  top: 0;
}
.content .show .showL {
  width: 246px;
  height: 481px;
  padding: 45px 56px 0;
  float: left;
}
.content .show .showL h3 {
  width: 246px;
  height: 22px;
  font-size: 20px;
  font-weight: 300;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #212121;
}
.content .showL h3 a {
  color: #212121;
}
.showL .author {
  margin: 10px 0 20px 0;
}
.showL .introduce {
  width: 246px;
  height: 64px;
  margin-bottom: 94px;
  line-height: 16px;
  overflow: hidden;
}
.show .showL span {
  width: 158px;
  height: 190px;
  float: right;
  position: relative;
}
.showL .bookCover {
  width: 156px;
  height: 208px;
}
.show .showL img {
  position: absolute;
  z-index: 1;
}
.show .showL .shadow {
  position: absolute;
  right: -20px;
  bottom: -20px;
  z-index: 0;
}
.show .showM {
  float: left;
  width: 358px;
  border-left: 1px solid #f0f0f0;
  box-sizing: border-box;
}
.show .showM li {
  float: left;
  width: 101px;
  padding: 40px 38px 42px;
  border-right: 1px solid #f0f0f0;
}
.show .showM li img {
  width: 102px;
  height: 136px;
}
.pubBook .showM li .bookName {
  color: #212121;
}
.show .showM li p a {
  color: #212121;
}
.pubbook .showM li p {
  width: 104px;
  height: 20px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.show .showM .tb {
  border-top: 1px solid #f0f0f0;
}
.show .showR {
  float: left;
  width: 253px;
  padding: 28px 0 0 30px;
}
.show .showR h3 {
  width: 228px;
  height: 30px;
  font-size: 20px;
  color: #f26552;
  position: relative;
  padding-left: 29px;
  font-weight: 300;
}
.crown {
  width: 21px;
  height: 18px;
  background-position: 0px -68px;
  float: left;
  position: absolute;
  left: 0;
  top: 2px;
}

.jxtitle {
  width: 1000px;
  text-align: center;
  padding: 44px 0 30px 0;
}
.jxtitle h2 {
  font-size: 26px;
  color: #212121;
  height: 36px;
}
.jxshow {
  background-color: #ffffff;
  height: 478px;
}
.cirbig {
  width: 1000px;
  height: 292px;
  border-bottom: 1px solid #f0f0f0;
}
.cirbig li {
  width: 333px;
  height: 242px;
  float: left;
  text-align: center;
  padding-top: 50px;
}
.cirbig .cirHead {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  position: relative;
}
.cirbig .cirHead img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  position: relative;
}
.cirbig .cirHead .fire {
  width: 24px;
  height: 24px;
  position: absolute;
  right: 0;
  top: -26px;
  background-position: -23px -66px;
}
.cirbig li h3 {
  font-size: 18px;
  width: 242px;
  height: 20px;
  overflow: hidden;
  margin: 16px auto 8px;
  color: #212121;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.content h3 a {
  color: #212121;
}
.cirbig li .little {
  width: 226px;
  height: 32px;
  line-height: 16px;
  overflow: hidden;
  margin: 0 auto;
  text-overflow: ellipsis;
}
.cirbig li .attent {
  margin-top: 20px;
  display: inline-block;
}

.cirbig li .attent s {
  float: left;
  width: 17px;
  height: 18px;
  background-position: -47px -68px;
  margin: 0 8px 0 10px;
}
.cirbig li .attent i {
  float: left;
  font-size: 14px;
}
.cirbig li .attent .cards {
  background-position: -68px -68px;
}
.cirbig .middle {
  border-left: 1px solid #f0f0f0;
  border-right: 1px solid #f0f0f0;
  width: 331px;
}
.zwtit {
  padding: 22px 0 0 0;
  text-align: center;
}
.zwtit img {
  width: 149px;
  height: 29px;
}
.zwqz {
  display: block;
}
.cirLittle {
  padding: 0 40px;
  height: 129px;
}
.cirLittle li {
  width: 162px;
  padding: 30px 0 0 22px;
  overflow: hidden;
  float: left;
}
.cirLittle li .litHead {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  float: left;
}
.cirLittle li .litHead img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.zwqz li .bookCon {
  padding: 8px 0 0 10px;
}
.cirLittle li h3 {
  font-size: 16px;
  margin-bottom: 2px;
}
.cirLittle li .bookCon p {
  height: 25px;
  font-size: 12px;
}
/* 男生频道 */
.nsbook .showM {
  padding-top: 0;
}
.nsbook .showM li {
  width: 141px;
  padding: 26px 18px 26px;
  overflow: hidden;
  border-right: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
}
.nsbook .showM li h3 {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 4px;
  width: 142px;
  height: 20px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #212121;
}
.nsbook .showM li .name {
  margin: 6px 0 10px;
}
.nsbook .showM li .introduce {
  width: 142px;
  height: 62px;
  overflow: hidden;
  line-height: 16px;
  text-overflow: ellipsis;
}
</style>